gwthm-in / pytest-pspec Goto Github PK
View Code? Open in Web Editor NEWRspec kind of formatter for Python Pytest.
License: MIT License
Rspec kind of formatter for Python Pytest.
License: MIT License
pytest-sugar is a plugin that changes the reporter and makes it nicer.
Since this plugin also implements a reporter, we need to provide an integration point for those who use both.
I sometimes have pretty long docstrings explaining what the test does / why it was added. For the output, I would only want the first line of such long docstrings to be used (the "summary line").
Please note that the first line might be empty ... so technically the second line. The first line which has more than just whitespace.
(PS: Awesome plugin!)
For pypdf, executed as pytest tests/test_xmp.py --pspec
:
installing pspec on pytest will cause testing dicovery to fail due to undexpcted pytest node
Unfortunately pytest-dev/pytest-instafail doesn't work because it also overrides TerminalReporter
.
Going back to the original TerminalReporter
output is not an option after having used your plugin - its output is very nice!
Really like the clarity this plugin provides. I did notice that when running tests with parametrization, it does not show which parameter is being used.
When pytest-pspec
is installed pytest --collect-only -q
fails to deal with tests that have no classes, seems to be the case with unittest or without
Here is a simple test module with one normal test and one unittest:
cat <<EOT >> test_broken_collect.py
import unittest
def test_no_unittest(): pass
class TestSome(unittest.TestCase):
def test_this(self): pass
EOT
Let's collect:
pytest test_broken_collect.py --collect-only -q
Getting:
test_broken_collect.py::::test_no_unittest
test_broken_collect.py::TestSome::test_this
The first test item is bogus - it should be examples/seq2seq/test_broken_collect.py::test_no_unittest
(i.e. 2 colons and not 4). If we feed it back to pytest
it fails to run a test it reported it collected.
update: I first thought it had to do with mixing unittest, but it fails with just normal tests w/o classes too:
cat <<EOT >> test_broken_collect.py
def test_no_unittest(): pass
EOT
same problem, getting test_broken_collect.py::::test_no_unittest
pytest 6.0.1
Thanks.
Hello!
I get a warning every time I use pytest-pspec:
python3.7/site-packages/pytest_pspec/plugin.py:77:
UserWarning: Argument(s) ('config',)
which are declared in the hookspec can not be found in this hook call
res = self.config.hook.pytest_report_teststatus(report=report)
$ pytest --version
This is pytest version 4.4.0
setuptools registered plugins:
pytest-pspec-0.0.3
pytest-mock-1.10.3
pytest-asyncio-0.10.0
What can be done about it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.