Allow to only run unit tests with Tox #181

Merged
witten merged 2 commits from :cifix/add-unit-test-only-env into master 2019-05-19 22:07:16 +00:00
Contributor

I found this useful to get faster feedback when running the tests for witten/borgmatic#180. Also, I could not pass the posargs to the pytest invocation (I'll submit in another PR). Anyway, this allows to run tox -e unit-test -- {posargs and not have black/isort/etc. run

I found this useful to get faster feedback when running the tests for https://projects.torsion.org/witten/borgmatic/pulls/180. Also, I could not pass the `posargs` to the pytest invocation (I'll submit in another PR). Anyway, this allows to run `tox -e unit-test -- {posargs` and not have black/isort/etc. run
Author
Contributor

I could not pass the posargs to the pytest invocation (I’ll submit in another PR)

On second thoughts, maybe I won't submit a PR for this. The main testenv mixes commands and therefore it is not clear which should get the posargs. I think this new testenv solves that for the case of pytest.

> I could not pass the posargs to the pytest invocation (I’ll submit in another PR) On second thoughts, maybe I won't submit a PR for this. The main `testenv` mixes commands and therefore it is not clear which should get the posargs. I think this new `testenv` solves that for the case of `pytest`.
Owner

Thanks for working on this.. Seems like a good idea to me. A couple of thoughts:

  • Pretty minor, but I would prefer to call this new Tox environment something like just test, as it includes both unit tests and integration tests.
  • Looks like in this Tox environment, you're defaulting to -v if no positional args are given. Is that just because the default pytest verbosity level is insufficient? Does not seem like a problem.. Just curious.
  • I think it's totally legitimate to pass positional arguments to the default Tox environment's pytest invocation. I've seen that pattern in several other projects, even when thre are multiple commands invoked. I think the idea is that, most often, you'll want to tweak the test run rather than any of the other commands.
Thanks for working on this.. Seems like a good idea to me. A couple of thoughts: * Pretty minor, but I would prefer to call this new Tox environment something like just `test`, as it includes both unit tests *and* integration tests. * Looks like in this Tox environment, you're defaulting to `-v` if no positional args are given. Is that just because the default pytest verbosity level is insufficient? Does not seem like a problem.. Just curious. * I think it's totally legitimate to pass positional arguments to the default Tox environment's pytest invocation. I've seen that pattern in several other projects, even when thre are multiple commands invoked. I think the idea is that, most often, you'll want to tweak the test run rather than any of the other commands.
Author
Contributor

Hey, thanks for taking a look at it.

I've done the following then:

    1. Renamed to test
    1. Removed -v as there was no real preference around this
    1. Passed posargs now to the default testenv pytest
Hey, thanks for taking a look at it. I've done the following then: * 1) Renamed to `test` * 2) Removed `-v` as there was no real preference around this * 3) Passed `posargs` now to the default testenv `pytest`
Owner

Thanks, looks good!

Thanks, looks good!
witten closed this pull request 2019-05-19 22:07:16 +00:00
decentral1se deleted branch cifix/add-unit-test-only-env 2019-05-19 22:16:45 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#181
No description provided.