Skip to content

Commit

Permalink
Review feedback.
Browse files Browse the repository at this point in the history
[ci skip-rust-tests]
  • Loading branch information
stuhood committed Jul 21, 2020
1 parent 4ffa262 commit 01f7336
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/python/pants/engine/internals/graph_test.py
Expand Up @@ -153,7 +153,7 @@ def test_transitive_targets_tolerates_subtarget_cycles(self) -> None:
Address("", target_name="t2.txt", generated_base_target_name="t2"),
]

def do_test_failed_cycle(self, address_str: str, cyclic_address_str: str) -> None:
def assert_failed_cycle(self, address_str: str, cyclic_address_str: str) -> None:
with self.assertRaisesRegex(
Exception,
f"(?ms)Dependency graph contained a cycle:.*-> {cyclic_address_str}.*-> {cyclic_address_str}.*",
Expand All @@ -172,7 +172,7 @@ def test_cycle_self(self) -> None:
"""
),
)
self.do_test_failed_cycle("//:t1", "//:t1")
self.assert_failed_cycle("//:t1", "//:t1")

def test_cycle_direct(self) -> None:
self.add_to_build_file(
Expand All @@ -184,8 +184,8 @@ def test_cycle_direct(self) -> None:
"""
),
)
self.do_test_failed_cycle("//:t1", "//:t1")
self.do_test_failed_cycle("//:t2", "//:t2")
self.assert_failed_cycle("//:t1", "//:t1")
self.assert_failed_cycle("//:t2", "//:t2")

def test_cycle_indirect(self) -> None:
self.add_to_build_file(
Expand All @@ -198,8 +198,8 @@ def test_cycle_indirect(self) -> None:
"""
),
)
self.do_test_failed_cycle("//:t1", "//:t2")
self.do_test_failed_cycle("//:t2", "//:t2")
self.assert_failed_cycle("//:t1", "//:t2")
self.assert_failed_cycle("//:t2", "//:t2")

def test_resolve_generated_subtarget(self) -> None:
self.add_to_build_file("demo", "target(sources=['f1.txt', 'f2.txt'])")
Expand Down

0 comments on commit 01f7336

Please sign in to comment.