Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to restrict to tests in specific directory #125

Open
RnoldR opened this issue Dec 12, 2018 · 1 comment
Open

Add option to restrict to tests in specific directory #125

RnoldR opened this issue Dec 12, 2018 · 1 comment

Comments

@RnoldR
Copy link

RnoldR commented Dec 12, 2018

Description of your problem

When I run the test I get the following errors (please implement a text copy command in unit testing pane):
not run t.test_add_seq
not run t.test_replace_seq
failure p.test_base64_img_collection_error

The failure is caused by a test in a complete other file: pocs/test_base64_img.py
The pocs directory is a directory in the current working directory. In the cwd the files music_utilities.py and test_music_utilities.py reside. It seems that spyder-unittest searches for all files in all directories from the cwd.

What steps will reproduce the problem?

This is the file test_music_utilities.py

from music_utilities import MusicFiles

Test the musicfiles class

def test_add_seq():
assert MusicFiles.seq_name('d.csv', 2) == 'd_0002.csv'

def test_replace_seq():
MusicFiles.seq_name('d_3.csv', 2) == 'd_0002.csv'

It is aimed at testing the file music_utilities.py

What is the expected output? What do you see instead?

True
True

What I see instead is described in the problem description

Key versions and other information:

  • Spyder version: 3.3.1
  • Version of spyder-unittest plugin: 0.3.1
  • Installation method for Spyder and the unittest plugin: Anaconda / pip / ... anaconda
  • Python version: 3.5.6
  • Testing framework used: py.test
  • Testing framework version: 3.8.1
  • Operating system: ubuntu 18.04
@jitseniesen
Copy link
Member

This is how pytest works by default. It looks in all subdirectories for tests. Normally all tests are run, but certain errors (e.g. syntax errors) cause pytest to give up before running the tests. Without more information, it is impossible to know specifically what is happening in this case.

I think what is needed here is an option to run tests only in a specific directory, just like #88 asks for running a specific test, so that's how I'll interpret this issue.

@jitseniesen jitseniesen changed the title spyder-unittest does not run the tests Add option to restrict to tests in specific directory May 5, 2020
@jitseniesen jitseniesen added this to the v0.5.1 milestone Jan 6, 2022
@jitseniesen jitseniesen removed the v0.5.0 label Jan 6, 2022
@jitseniesen jitseniesen modified the milestones: v0.5.1, v0.5.2 Aug 17, 2022
@jitseniesen jitseniesen removed their assignment Aug 17, 2022
@jitseniesen jitseniesen modified the milestones: v0.5.2, v0.6.0 Mar 24, 2023
@jitseniesen jitseniesen modified the milestones: v0.6.0, v0.7.0 Jun 10, 2023
@jitseniesen jitseniesen modified the milestones: v0.7.0, v0.7.1 Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants