Comments (11)
@alexanderankin of course you can keep the test classes.
When unittest encounters assert expr
, it only says the expr
is but does not analyze the expression. That's what all those self.assertSomething
methods are for. pytest
analyzes the expression. That's why the switch would have to be planned and there's (almost) no way back to the stdlib unittest.
I am just asking whether you're considering it. Today I have also tried to introduce pathlib.Path
for all directory/files operations, but in the tests that would be too much overhead without using the tmp_path
fixture from pytest
.
from fpdf2.
It does catch assert
errors:
assert x > y, "wrong order
will tell you wrong order
But if you give pytest
assert x > y
it will print the values of x
and y
as well.
from fpdf2.
there seems to be a consensus in the python community on pytest lol. I use java at work, so i see lots of the self.assertEquals and hamcrest methods (without the self, though b/c its java). I think pytest overall is the right move in order to keep it going. according to the internet this is worthwhile.
from fpdf2.
Thank you very much for the time you are taking in improving fpdf2
tests!
I see you already opened a PR: #80 😮
Awesome! I'm going to comment on it & continue the discussion there
from fpdf2.
from fpdf2.
I think switching to assert
will break compatibility with unittest
.
I'm used to pytest
and I know the many useful features it would provide, so I'm favorable overall.
However @alexanderankin has been maintaining this project for longer than I have, and I'd prefer not to operate this change if he's not comfortable with it 😉
from fpdf2.
from fpdf2.
from fpdf2.
Great!
Let's go with pytest
then!
@eumiro are you volunteering to do the transition? 😊
from fpdf2.
Great!
Let's go withpytest
then!@eumiro are you volunteering to do the transition? blush
I can certainly help you to prepare the directories and start the migration, but then it looks like a nice bunch of good-first-issues for other contributors.
I'd propose to create a new directory tests
with the subdirectory testdata
and in a new branch start copying the tests and their test data there. Once it's done, the old test
directory can be removed and after the merge the CI will run the new tests.
from fpdf2.
Done in #82
Closing this
from fpdf2.
Related Issues (20)
- Leading spaces on new lines ignored in <pre><code> tags HOT 7
- Tables with multiple header rows and merging cells HOT 4
- Test failure in test_share_images_cache on fast computers HOT 1
- Expected behaviour re outer table border with nonzero gutter? HOT 5
- Sections must have a style HOT 2
- Long HTML list entries are not correctly indented HOT 24
- HTML blockquotes are not indented HOT 1
- Combination of set_text_shaping and offset_rendering causing error HOT 5
- `KeyError: '{http://www.w3.org/2000/svg}path'` when using an svg HOT 4
- Error when using multi-page tables in table of contents placeholder HOT 5
- Headings and Title styles HOT 5
- No way to control line spacing inside table cell HOT 2
- {nb} breaks if text shaping is turned on with certain fonts HOT 7
- I'm not sure if it's by design or if it's a bug but .insert_toc_placeholder creates an extra blank page HOT 2
- FPDFRecorder frequent usage makes document generation slow HOT 4
- Markdown formatting in cell and multicell fails for some combinations HOT 1
- How to hide 'DeprecationWarning' messages HOT 3
- Github Actions is not working because pdfchecker URL is broken HOT 2
- Replace black/pylint with ruff HOT 2
- Add a documentation that containing Markdown File HOT 2
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 fpdf2.