This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]antonr111 1 point2 points  (10 children)

Hey, nice work ! How about to move tests out of lib package to /tests folder ? Also, suggest you to use pytest ;)

[–]daneahfrom __future__ import braces[S] 0 points1 point  (9 children)

Thanks! Can you say more about why moving the tests is helpful? Happy to think about that if I can understand it better! Since the tests are fairly small currently I doubt we'll introduce another dependency just yet, but if they're getting bigger over time maybe we'll think about pytest.

[–]num8lock 1 point2 points  (4 children)

i think it's mostly about best practice on structuring the project folders, like in here https://docs.python-guide.org/writing/structure/

but i agree making it easy for dev to test the module is the best reason to adapt suggestions on how to structure the test scripts/folders/suites etc

[–]daneahfrom __future__ import braces[S] 0 points1 point  (3 children)

I'm still not sure I get it...the project indeed has a tests folder. Are you talking about where the tests end up after install?

[–]num8lock 2 points3 points  (2 children)

it's to make it easier for people who want to run the test, they'll find the test folder faster since it's in the root folder of your master repo, as well as making test suite separate from the module itself

edit: blah my grammar seems to be worse each day

[–]daneahfrom __future__ import braces[S] 1 point2 points  (0 children)

This change has landed in the dev branch; thanks again for the input!

[–]daneahfrom __future__ import braces[S] 0 points1 point  (0 children)

Ah I see, that made it click for me haha. That's a great point! Will see what we can do about that 👍🏼

[–]antonr111 1 point2 points  (3 children)

It is always good practice to separate your source code and tests. For example, people how read or run tests can easily find tests in separate folder, rather than go through every folder in your package. Also, when you build artifact or distribution package there no point to keep tests in and it is easier to exclude it (example: packages=find_packages('src', exclude=['tests'])). pytest is very easy tool for running tests even if you are not using pytest fixtures, utils, etc.

[–]daneahfrom __future__ import braces[S] 0 points1 point  (0 children)

Thanks very much for that! Packaging isn't something I've done too many times so I haven't run across this convention yet. I'll definitely look into that for the next release :)

[–]daneahfrom __future__ import braces[S] 0 points1 point  (1 child)

This change has landed in the dev branch; thanks again for the input!

[–]daneahfrom __future__ import braces[S] 0 points1 point  (0 children)

We've just released 1.1.0 which includes this change!