summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-03-07 17:51:38 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-03-11 06:38:42 -0500
commitb9f4c86917422de3fe6ecd2976d7213897c93bb2 (patch)
treec8da98046baddd68bcde6a0834f861e071a69a49 /tests/test_api.py
parentaf234f4a2a08dc1616c2270df6349925221c81e8 (diff)
downloadpython-coveragepy-git-b9f4c86917422de3fe6ecd2976d7213897c93bb2.tar.gz
test: reduce use of unittest
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 391a52e0..a865c24c 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -884,7 +884,7 @@ class SourceIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest):
assert lines['p1c'] == 0
def test_source_package_as_dir(self):
- self.chdir(self.nice_file(TESTS_DIR, 'modules'))
+ os.chdir(self.nice_file(TESTS_DIR, 'modules'))
assert os.path.isdir("pkg1")
lines = self.coverage_usepkgs(source=["pkg1"])
self.filenames_in(lines, "p1a p1b")
@@ -910,7 +910,7 @@ class SourceIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest):
# the search for unexecuted files, and given a score of 0%.
# The omit arg is by path, so need to be in the modules directory.
- self.chdir(self.nice_file(TESTS_DIR, 'modules'))
+ os.chdir(self.nice_file(TESTS_DIR, 'modules'))
lines = self.coverage_usepkgs(source=["pkg1"], omit=["pkg1/p1b.py"])
self.filenames_in(lines, "p1a")
self.filenames_not_in(lines, "p1b")
@@ -925,7 +925,7 @@ class SourceIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest):
def test_ambiguous_source_package_as_dir(self):
# pkg1 is a directory and a pkg, since we cd into tests/modules/ambiguous
- self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambiguous"))
+ os.chdir(self.nice_file(TESTS_DIR, 'modules', "ambiguous"))
# pkg1 defaults to directory because tests/modules/ambiguous/pkg1 exists
lines = self.coverage_usepkgs(source=["pkg1"])
self.filenames_in(lines, "ambiguous")
@@ -933,7 +933,7 @@ class SourceIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest):
def test_ambiguous_source_package_as_package(self):
# pkg1 is a directory and a pkg, since we cd into tests/modules/ambiguous
- self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambiguous"))
+ os.chdir(self.nice_file(TESTS_DIR, 'modules', "ambiguous"))
lines = self.coverage_usepkgs(source_pkgs=["pkg1"])
self.filenames_in(lines, "p1a p1b")
self.filenames_not_in(lines, "p2a p2b othera otherb osa osb ambiguous")