Answer stability round 1: 0 🔴, 14 🟡 (0 misread); tests that kill the surviving mutants, with a versioned MemoryStore and appended_to, plan/named_paths.py, TakenIn's docstring and the run-heavy rule naming LAUNCHERS; three places left to item 300
CI / tests (pull_request) Successful in 3m10s
CI / tests (pull_request) Successful in 3m10s
This commit is contained in:
@@ -2,6 +2,7 @@ import ast
|
||||
import graphlib
|
||||
import pathlib
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
@@ -36,6 +37,16 @@ class PackageCycles(unittest.TestCase):
|
||||
def test_no_package_under_bin_imports_one_that_imports_it_back(self):
|
||||
self.assertEqual(cycle(package_imports(ROOT / "bin")), [], "move what both packages need into a package that imports neither")
|
||||
|
||||
def test_reads_an_import_deferred_into_a_function_and_leaves_out_tests(self):
|
||||
with tempfile.TemporaryDirectory() as temp:
|
||||
folder = pathlib.Path(temp)
|
||||
for package, source in (("a", "def f():\n\tfrom b.mod import x\n"), ("b", "import a.mod\n"), ("c", "")):
|
||||
(folder / package).mkdir()
|
||||
(folder / package / "__init__.py").write_text("")
|
||||
(folder / package / "mod.py").write_text(source)
|
||||
(folder / "c" / "test_mod.py").write_text("import a\n")
|
||||
self.assertEqual(package_imports(folder), {"a": {"b"}, "b": {"a"}, "c": set()})
|
||||
|
||||
def test_a_cycle_through_a_deferred_import_is_found(self):
|
||||
self.assertEqual(sorted(cycle({"a": {"b"}, "b": {"a"}})[:2]), ["a", "b"])
|
||||
self.assertEqual(cycle({"a": {"b"}, "b": set()}), [])
|
||||
|
||||
Reference in New Issue
Block a user