question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exclude specific plugins from xunit2 output

See original GitHub issue
  • a detailed description of the bug or suggestion It would be nice if specific plugins’ output could be omitted from xunit2 report, for instance via include/exclude params in pytest.ini. In this particular case I’m filtering out testcases with name="PYTEST", because it’s reporting source files as test (and mostly skips when unchanged).

  • output of pip list from the virtual environment you are using

Django==2.2.12
pylint==2.5.0
pytest==5.4.1
pytest-cov==2.8.1
pytest-django==3.9.0
pytest-pylint==0.16.1
  • pytest and operating system versions For pytest, see versions above from pip Windows 10 with Python 3.6.7 & 3.7.4 Ubuntu 18.04 (on WSL) with Python 3.6.7 & 3.7.7

  • minimal example if possible Useless testcase output is providing incompatible class name and reports source files as testcases

    <testcase classname="manage../c/path/to/repo/source/manage.py" name="PYLINT" time="0.001">
      <skipped message="file(s) previously passed pylint checks" type="pytest.skip">
        ~/.virtualenvs/app367/lib/python3.6/site-packages/pytest_pylint/plugin.py:319: file(s) previously passed pylint checks
      </skipped>
    </testcase>
    <testcase classname="app.admin./c/path/to/repo/source/app/admin.py" name="PYLINT" time="0.007"></testcase>

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nicoddemuscommented, Jun 25, 2020

Sorry if I was not clear, I understood the use case, I was wondering what the option would look like.

An option combo like --ignore and --ignore-glob for the testcase/class name could do the trick in this case, because all pylint cases are named “PYLINT”.

For example something like this?

[pytest]
junit_ignore_casename_glob = PYLINT
0reactions
wkootcommented, Jun 28, 2020

@RonnyPfannschmidt I’m inclined to agree with you, but that would suggest not having pytest-pylint at all?

The settings for unittest / coverage (pytest-cov) / linter (pytest-pylint) all go in pytest.ini. I can’t run pytest for different use cases (tests/coverage, linting) from a single pytest.ini file (they inherit addopts anyway). In my pipeline I import the pytest output in Sonar with SonarPython, which has deprecated running pylint itself.

@nicoddemus that option also sounds fine, it is indeed more particular to the xunit output So then it would be junit_ignore_casename_glob/--junit-ignore-casename-glob=XYZ and junit_ignore_casename/--junit-ignore-casename=XYZ

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I skip specific tests in xUnit based on current platform
What I do want however, is to apply an ignore to those tests, and have the fact that the test was ignored flagged...
Read more >
xunit2 format does not contain a root <testsuites> tag #5477
The main thing I find missing in the currently output XML is that the top-level testsuites (plural!) tag is missing. The Schema allows...
Read more >
Exclude plugin if certain platform - Unity Forum
Hi Uniteers, We have implemented Voxelbusters Lite into our project, but the plugin isn't supported for Windows Phone and outputs compile ...
Read more >
Exclude Plugins from JS Minify/Combine - WordPress.org
I'm trying to exclude a specific plugin (Real Cookie Banner) from being combined into the Asset Cleanup JS file, as it causes conflicts...
Read more >
pytest Documentation - Read the Docs
To disable loading specific plugins at invocation time, use the -p ... you can run the test module and get the custom output...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found