Skip to content

Commit

Permalink
Merge pull request #108 from QCoDeS/dv/move_tests
Browse files Browse the repository at this point in the history
Move tests into package to include them into distribution
  • Loading branch information
trevormorgan authored Jun 3, 2022
2 parents 0e57973 + 7d553cf commit b73dd8d
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/static/environment_forge_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- matplotlib>=2.2.3
- schema
# test requirements
- hypothesis>=5.49.0
- hypothesis==6.46.7
- pytest>=6.0.0
- mypy
- mypy_extensions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conda-forge-install-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
- name: run pytest
shell: bash -l {0}
run: |
pytest --hypothesis-profile ci
pytest --hypothesis-profile ci broadbean
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: mypy broadbean
- name: Run tests
run: |
pytest --cov=broadbean --cov-report xml --hypothesis-profile ci
pytest --cov=broadbean --cov-report xml --hypothesis-profile ci broadbean
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.0
with:
Expand Down
Empty file added broadbean/tests/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/test_element.py → broadbean/tests/test_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def test_addArray():


@settings(max_examples=25, suppress_health_check=(HealthCheck.function_scoped_fixture,))
@given(SR1=hst.integers(min_value=1,max_value=25e8), SR2=hst.integers(min_value = 1,max_value = 25e8),
N=hst.integers(min_value=2,max_value=25e6), M=hst.integers(min_value=2,max_value=25e6))
@given(SR1=hst.integers(min_value=1,max_value=25*10**8), SR2=hst.integers(min_value = 1,max_value = 25*10**8),
N=hst.integers(min_value=2,max_value=25*10**6), M=hst.integers(min_value=2,max_value=25*10**6))
def test_invalid_durations(SR1, SR2, N, M):
"""
There are soooo many ways to have invalid durations, here
Expand Down Expand Up @@ -208,7 +208,7 @@ def test_input_fail1(improper_bp):


@settings(max_examples=25, suppress_health_check=(HealthCheck.function_scoped_fixture,))
@given(SR=hst.integers(min_value=1,max_value=25e8), N=hst.integers(min_value=2,max_value=25e6))
@given(SR=hst.integers(min_value=1,max_value=25*10**8), N=hst.integers(min_value=2,max_value=25*10**6))
def test_points(SR, N):
elem = Element()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_forging.py → broadbean/tests/test_forging.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _has_period(array: np.ndarray, period: int) -> bool:
return True


@given(SR=hst.integers(min_value=100, max_value=50e9),
@given(SR=hst.integers(min_value=100, max_value=50*10**9),
ratio=hst.floats(min_value=1e-6, max_value=10))
def test_too_short_durations_rejected(SR, ratio):

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hypothesis
hypothesis==6.46.7
pytest
pytest-cov
coverage[toml]
Expand Down

0 comments on commit b73dd8d

Please sign in to comment.