Comments (5)
Running tests using tox is supported, but only within the Docker container provided in tests/Dockerfile. I agree it's a bit misleading to provide a top-level tox.ini that's not intended to be run directly from the current system. I think we should just move our tox.ini to tests/tox.ini. Would that help your automated packaging script?
from sh.
It would be helpful if you provide some more information. Where did you find the advice to run tests this way? How did you set up your test environment?
In general, there are two ways to run tests - Using Docker as described in the README, or using poetry as documented in https://github.com/amoffat/sh/blob/1c0dc81fb7fb7fd1d23d80082498ad3059154e79/.github/workflows/main.yml
from sh.
I'm packaging sh
for OpenIndiana (together with hundreds other Python projects) and during the package build the build framework runs tests. When a project supports tox
(i.e. tox.ini
file is present) then the default and so far almost always[1] working way to run tests is just to invoke something similar to tox -e py39
[2].
Since I package sh
for an operating system where the package will be run in real and current environment (not in a virtual one) then there is little sense to test sh
using docker for my use case.
If I parsed the main.yaml file properly then the actual command to run tests should be this:
SH_TESTS_RUNNING=1 SH_TESTS_USE_SELECT=${{ matrix.use-select }} LANG=${{ matrix.lang }} poetry run coverage run -a -m unittest
Thanks for the hint. I'll play with it and report back.
[1] IIRC, sh
is first case with tox.ini
file available and supported when running tests using tox
is ... unsupported(?); there is/was similar problem with poetry_core, but it looks like they decided to remove support for tox.
[2] We use a bit more complex test setup than that, but that's not important for now.
from sh.
It looks like simple unittest
testing works properly. That's just python -m unittest
. This does require neither poetry
, nor coverage
. Both looks like unneeded overhead for integration testing needed for my packaging effort.
The move of current tox.ini
to tests/tox.ini
is probably good idea to avoid future confusion. For my particular case it won't help much because since I already know that the tox
testing does not work as I would expect I simply switched to unittest
and I no longer care about top-level tox.ini
.
from sh.
Marking this as closed. If there is any followup discussion please re-open.
from sh.
Related Issues (20)
- Is test_general_signal timing sensitive? HOT 2
- ssh contrib doesn't interact HOT 5
- Can you run `gum filter` with sh?
- piping not working HOT 3
- Nested contexts duplicate commands HOT 1
- 2.0.4: pytest is failing in two units HOT 6
- Requires 3.8.1 specifically, instead of just 3.8 HOT 5
- RFE: please start making github releases HOT 6
- Automate github releases
- "Bad" signals can't be ignored with _ok_code HOT 5
- cannot import name 'pg_dump' from 'sh' HOT 2
- Github page link 404s HOT 2
- glob wrapper breaks glob(.., root_dir=someething) HOT 1
- Special kwarg _cwd and sh.pushd() not working HOT 5
- baking piped commands HOT 2
- piped commands via ssh? HOT 4
- RFH: Unable to pipe `sudo` process to `sudo` process HOT 3
- sh doesn't print output unless wrapped in print() HOT 1
- Feature proposal: _except callback HOT 6
- documentation has bad example code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sh.