• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

adrienverge / yamllint / 14360196734 / 1
100%
master: 100%

Build:
DEFAULT BRANCH: master
Ran 09 Apr 2025 02:49PM UTC
Files 67
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Apr 2025 02:48PM UTC coverage: 99.791% (+0.07%) from 99.722%
14360196734.1

push

github

adrienverge
Rename tests.common.test_codec_built_in_equivalent()

Some of the functions in the test package are automatically run by test
frameworks and some functions in the test package are not. How do test
frameworks determine which functions should get run automatically? The
answer to that question depends on what test framework you are using.

Python’s built-in unittest framework uses the unittest.TestCase class to
figure out which which function should get run automatically. You have
to put your functions in subclasses or instances of the
unittest.TestCase class or else unittest won’t automatically run your
code [1].

The pytest framework works differently. By default, pytest will still
look for unittest.TestCase subclasses and instances, but it will also
run functions with names that begin with “test” even if those functions
aren’t inside any classes or instances [2].

When I had first written the test_codec_built_in_equivalent() function,
I had only tested it with the unittest framework. The unittest framework
does not run that function automatically because it’s not inside a
unittest.TestCase subclass or instance. The pytest framework, on the
other hand, will try to run test_codec_built_in_equivalent()
automatically because it’s name starts with “test”.
test_codec_built_in_equivalent() has one mandatory parameter, but pytest
doesn’t know what value to use for that parameter, so pytest will fail
to run that function.

This change prevents pytest from failing to run that function by
renaming it to built_in_equivalent_of_test_codec(). The function was
never supposed to be run automatically anyway.

Fixes #734.

[1]: <https://docs.python.org/3/library/unittest.html#organizing-test-code>
[2]: <https://docs.pytest.org/en/stable/explanation/goodpractices.html#conventions-for-python-test-discovery>

4304 of 4313 relevant lines covered (99.79%)

1.0 hits per line

Source Files on job 14360196734.1
  • Tree
  • List 67
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 14360196734
  • a942f5cd on github
  • Prev Job for on master (#14357283767.3)
  • Next Job for on master (#14396599933.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc