Skip to content
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

Some scripts are tagged as tests when they should not #311

Open
dgarijo opened this issue Sep 19, 2021 · 3 comments
Open

Some scripts are tagged as tests when they should not #311

dgarijo opened this issue Sep 19, 2021 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dgarijo
Copy link
Collaborator

dgarijo commented Sep 19, 2021

Right now we check if the assert commands are used in tests.
I have detected some places (e.g., repo Tface) where the assert expressions are used just to check if the inputs to the script are correct. This is not a good practice, but we should not assume that any function with assert is a test. Alternatives:

  • Check if any of the imports include the test frameworks.
  • Check if the assert functions are the last call in the target function. This way, we'll know it is a test instead of asserting a in input condition.
@dgarijo dgarijo added the bug Something isn't working label Sep 19, 2021
@dgarijo dgarijo self-assigned this Sep 19, 2021
@dgarijo
Copy link
Collaborator Author

dgarijo commented Sep 19, 2021

Other repos to test this with: asciicinema, pyLODE, PyCG

@dgarijo
Copy link
Collaborator Author

dgarijo commented Sep 24, 2021

We could flag assert in non-tests as a bad practice.

@dgarijo
Copy link
Collaborator Author

dgarijo commented Sep 24, 2021

@rosafilgueira says that the function extract_relations can be used to address the first issue (see which files are imported in which)

@dgarijo dgarijo added this to the v0.0.1 milestone Sep 24, 2021
@dgarijo dgarijo modified the milestones: v0.0.1, v0.0.2 Jan 20, 2022
@dgarijo dgarijo modified the milestones: v0.0.2, v0.0.3 Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant