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

Rename testscour.py to test_scour.py to make py.test work out of the box #181

Merged
merged 1 commit into from
May 17, 2020

Conversation

nthykier
Copy link
Contributor

This rename makes py.test/py.test-3 find the test suite out of the
box. Example command lines:

   # Running the test suite
   $ py.test-3
   # Running the test suite with coverage enabled (and branch
   # coverage).
   $ py.test-3 --cov=scour --cov-report=html --cov-branch

Signed-off-by: Niels Thykier niels@thykier.net

@codecov-io
Copy link

Codecov Report

Merging #181 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #181   +/-   ##
=======================================
  Coverage   91.49%   91.49%           
=======================================
  Files           5        5           
  Lines        2127     2127           
=======================================
  Hits         1946     1946           
  Misses        181      181

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ea126d...38c3827. Read the comment docs.

@Ede123
Copy link
Member

Ede123 commented Mar 26, 2018

Is there somewhere an explanation what pytest improves upon standard Python functionality?

I always dislike packages that seem to do what is already possible (maybe just in a different, often not even really more convenient way).

Long term I'd prefer to split the huge testscour.py into smaller modules and put them into a test/ subdirectory, but I did not get around to that yet...

Sorry for slow response times, I'm pretty busy these days, so it might take some time before I'm able to look into the remaining PRs (I'll look into them eventually, though, I promise).

@nthykier
Copy link
Contributor Author

nthykier commented Mar 29, 2018 via email

@Ede123
Copy link
Member

Ede123 commented Apr 15, 2018

Do you have any public notes about what you were planning/expecting from the refactoring? Like how you wanted to group the tests and the fixtures/input files.

No, everything that exists is basically in my head and not developed any more than:

  • I want a "tests" directory (not sure in which folder - might belong into /scour)
  • This directory contains files like "test_xyz.py" which is basically the curent "testscour.py" split by topic, i.e. "xyz" will be things like "cli", "css", "ids", "path", ...
  • Each test file can be run on it's own, by default however all tests are executed automatically

If you want to look into this feel free to open a dedicated issue where I'd be happy to discuss any ideas with you.

@oberstet
Copy link
Member

oberstet commented Apr 17, 2018

I am +1 on merging this (when it no longer conflicts;) - moving to pytest:

  • pytest is widely used, best practice in py community (it has less boilerplate than unittest, it has test fixtures https://docs.pytest.org/en/latest/fixture.html)
  • besides pytest, I'd consider these pretty standard tools: tox, coverage and mock

@nthykier
Copy link
Contributor Author

Regarding the merge conflict. I will gladly rebase it if @Ede123 agrees to the change. However, given that every pull request that touches the test suite will cause a new conflict, I am hesitant to update it now.

@Ede123
Copy link
Member

Ede123 commented Apr 18, 2018

I'm totally fine with it - it's not that the rename on it's own would change any functionality. I was just curious what pytest brings to the table.

Can we rename "testcss.py" -> "test_css.py" alongside with it for consistency or would this cause with pytest?

Feel free to rebase at any point...

@Ede123
Copy link
Member

Ede123 commented May 17, 2020

@nthykier If you still want to merge this, could you please rebase and rename "testcss.py" -> "test_css.py" as mentioned above?

This rename makes py.test/py.test-3 find the test suite out of the
box.  Example command lines:

       # Running the test suite (optionally include "-v")
       $ py.test-3
       # Running the test suite with coverage enabled (and branch
       # coverage).
       $ py.test-3 --cov=scour --cov-report=html --cov-branch

Signed-off-by: Niels Thykier <niels@thykier.net>
@nthykier
Copy link
Contributor Author

Rebased. It seems to work with the rename of testcss.py as well. :)

@Ede123
Copy link
Member

Ede123 commented May 17, 2020

Thanks! :-)

@Ede123 Ede123 merged commit a15acb3 into scour-project:master May 17, 2020
@nthykier nthykier deleted the py.test-support branch May 17, 2020 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants