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

adrienverge / yamllint / 14360196734
100%

Build:
DEFAULT BRANCH: master
Ran 09 Apr 2025 02:49PM UTC
Jobs 5
Files 67
Run time 1min
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.815%. Remained the same
14360196734

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>

3 of 3 new or added lines in 2 files covered. (100.0%)

4305 of 4313 relevant lines covered (99.81%)

4.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 14360196734.1 09 Apr 2025 02:49PM UTC 67
99.79
2 14360196734.2 09 Apr 2025 02:49PM UTC 67
99.72
3 14360196734.3 09 Apr 2025 02:49PM UTC 67
99.79
4 14360196734.4 09 Apr 2025 02:49PM UTC 67
99.79
5 14360196734.5 09 Apr 2025 02:49PM UTC 67
99.79
Source Files on build 14360196734
  • Tree
  • List 67
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • a942f5cd on github
  • Prev Build on master (#14357283767)
  • Next Build on master (#14396599933)
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