-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test refactor #166
Comments
I concur. Changing the tests when adding new functionality is becoming increasingly complex and thus error-prone. This might or might not be due to a design problem in these tests. Your list is a very nice way to start thinking through this. |
Relevant comments from #193:
@dataclass
class CompareI2D:
imports: List[ParsedImports] = field(default_factory=list)
dependencies: List[DeclaredDependency] = field(default_factory=list)
ignore_unused: List[UnusedDependency] = field(default_factory=list)
ignore_undeclared: List[UndeclaredDeps] = field(default_factory=list)
expected: Tuple[Dict[str, Package], List[UndeclaredDependency], List[UnusedDependency]]
pytest.param(
imports_factory("invalid_import"),
[],
[],
["invalid_import"],
({}, [], []),
id="one_ignored_undeclared_dep__not_reported_as_undeclared",
),
pytest.param(
{
"imports": imports_fac (tory("invalid_import"),
"ignore_undeclare": ["invalid_import"],
"expected": ({}, [], [])
},
id="one_ignored_undeclared_dep__not_reported_as_undeclared",
),
|
This issue was discussed in today's status meeting, and a couple of points from the meeting notes are worth repeating here:
|
As we advance in the complexity of objects representing the FD domain, our test code also grows in complexity.
It takes notably more time to change the test code base when changing the basic objects that are being tested.
We should:
Location
object should not propagate to all tests usingUndeclaredDependencies
)utils.py
and refactor tests cases to use thempytest.param
inputs (test in `compare_imports_to_dependencies) have now 5 variables, for which most is just an empty listhypothesis
for property-based testingThe text was updated successfully, but these errors were encountered: