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.

BUG: `tests` module is included in distribution

See original GitHub issue

In conda, I get the following error:

ClobberError: This transaction has incompatible packages due to a shared path.
  packages: conda-forge/noarch::pyprojroot-0.2.0-py_0, pytorch/noarch::captum-0.3.1-0
  path: 'lib/python3.8/site-packages/tests/__init__.py'

This suggests that this package is distributing a module called tests, which is wrong.

I assume that the same problem will occur with pip too.

In my experience, the best solution is a src layout as described in https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure and https://hynek.me/articles/testing-packaging/#src.

It’s also worth noting that the “tests outside application code” pattern usually doesn’t make the tests directory into a module: https://docs.pytest.org/en/latest/goodpractices.html?highlight=src#tests-outside-application-code. Note that this good practice guide also strongly suggests a src layout.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vivekmigcommented, May 13, 2021

Hi @jamesmyatt , we are planning to do the 0.4.0 release in the next few weeks, so this fix will be included there.

1reaction
vivekmigcommented, Mar 16, 2021

Thanks for catching this issue @jamesmyatt and the great suggestions! You are right, we were unintentionally distributing this tests module. For now, we have tested a fix to exclude the tests module, which should resolve the issue for future releases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Defect Clustering and Pareto Principle - Software Testing Help
Defect clustering means a small number of modules containing most of the defects. Basically, the defects are not distributed uniformly across ...
Read more >
Test-Kwalitee-Extra fails two tests with perl-5.29.8 - CPAN
To: bug-Test-Kwalitee-Extra@rt.cpan.org, Chad Granum <exodist7@gmail.com> ... Detail: This distribution uses a module or a dist in its test suite that's not ...
Read more >
7 Principles of Software Testing with Examples - Guru99
Defect Clustering which states that a small number of modules contain most of the defects detected. This is the application of the Pareto ......
Read more >
Which Software Test Metrics You Should Care About and Why
Metrics include Number of Tests Run, Defects per Test Hour, and Average Time to Test a Bug Fix. Defect distribution – Helps you...
Read more >
An Empirical Study of Bugs in Test Code - People
analysis, we only included projects that had at least one test bug report. ... Figure 4 depicts the distribution of silent horror bug...
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