Skip to content

Commit

Permalink
Merge pull request #172 from NASA-PDS/i171
Browse files Browse the repository at this point in the history
Modernize with pytest and tox
  • Loading branch information
jordanpadams authored Aug 20, 2024
2 parents 70f5249 + a2e162d commit 4370ff9
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 98 deletions.
130 changes: 78 additions & 52 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"version": "1.4.0",
"plugins_used": [
{
"name": "AbsolutePathDetectorExperimental"
},
{
"name": "ArtifactoryDetector"
},
Expand Down Expand Up @@ -84,6 +87,10 @@
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_baseline_file",
"filename": ".secrets.baseline"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
Expand Down Expand Up @@ -139,44 +146,8 @@
"filename": "setup.cfg",
"hashed_secret": "3a6d7aa49a8e4a2fe32a5cd0e53da9cb96bd8d29",
"is_verified": false,
"line_number": 33
}
],
"src/pds2/aipgen/tests/test_utils.py": [
{
"type": "Hex High Entropy String",
"filename": "src/pds2/aipgen/tests/test_utils.py",
"hashed_secret": "10a34637ad661d98ba3344717656fcc76209c2f8",
"is_verified": false,
"line_number": 49
},
{
"type": "Hex High Entropy String",
"filename": "src/pds2/aipgen/tests/test_utils.py",
"hashed_secret": "67a74306b06d0c01624fe0d0249a570f4d093747",
"is_verified": false,
"line_number": 50
},
{
"type": "Basic Auth Credentials",
"filename": "src/pds2/aipgen/tests/test_utils.py",
"hashed_secret": "25ab86bed149ca6ca9c1c0d5db7c9a91388ddeab",
"is_verified": false,
"line_number": 169
},
{
"type": "Email Address",
"filename": "src/pds2/aipgen/tests/test_utils.py",
"hashed_secret": "66ed46e8b325ac0c7982bd070c132bff14093bc3",
"is_verified": false,
"line_number": 169
},
{
"type": "Email Address",
"filename": "src/pds2/aipgen/tests/test_utils.py",
"hashed_secret": "fe5c714e9a30a923a58dac84e0af313c7fb7c553",
"is_verified": false,
"line_number": 179
"line_number": 33,
"is_secret": false
}
],
"test/data/insight_documents/urn-nasa-pds-insight_documents/document_hp3rad/release_notes.txt": [
Expand All @@ -185,7 +156,8 @@
"filename": "test/data/insight_documents/urn-nasa-pds-insight_documents/document_hp3rad/release_notes.txt",
"hashed_secret": "af6e7d5c95484d3b7d88a581b4d19912149baff0",
"is_verified": false,
"line_number": 15
"line_number": 15,
"is_secret": false
}
],
"test/data/insight_documents/urn-nasa-pds-insight_documents/document_ida/ida_release_notes.txt": [
Expand All @@ -194,7 +166,8 @@
"filename": "test/data/insight_documents/urn-nasa-pds-insight_documents/document_ida/ida_release_notes.txt",
"hashed_secret": "af6e7d5c95484d3b7d88a581b4d19912149baff0",
"is_verified": false,
"line_number": 15
"line_number": 15,
"is_secret": false
}
],
"test/data/insight_documents/urn-nasa-pds-insight_documents/document_rise/release_notes.txt": [
Expand All @@ -203,7 +176,8 @@
"filename": "test/data/insight_documents/urn-nasa-pds-insight_documents/document_rise/release_notes.txt",
"hashed_secret": "af6e7d5c95484d3b7d88a581b4d19912149baff0",
"is_verified": false,
"line_number": 15
"line_number": 15,
"is_secret": false
}
],
"test/data/insight_documents/urn-nasa-pds-insight_documents/document_seis/seis_release_notes.txt": [
Expand All @@ -212,7 +186,8 @@
"filename": "test/data/insight_documents/urn-nasa-pds-insight_documents/document_seis/seis_release_notes.txt",
"hashed_secret": "af6e7d5c95484d3b7d88a581b4d19912149baff0",
"is_verified": false,
"line_number": 15
"line_number": 15,
"is_secret": false
}
],
"test/data/insight_documents/urn-nasa-pds-insight_documents/readme.txt": [
Expand All @@ -221,7 +196,8 @@
"filename": "test/data/insight_documents/urn-nasa-pds-insight_documents/readme.txt",
"hashed_secret": "af6e7d5c95484d3b7d88a581b4d19912149baff0",
"is_verified": false,
"line_number": 32
"line_number": 32,
"is_secret": false
}
],
"test/data/naif3/spice_kernels/m2020_168_sclkscet_00007.tsc": [
Expand All @@ -230,14 +206,16 @@
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_00007.tsc",
"hashed_secret": "34af3d6f31b0b9c0d5bbbeb8d2e27a7623f8f481",
"is_verified": false,
"line_number": 67
"line_number": 67,
"is_secret": false
},
{
"type": "Email Address",
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_00007.tsc",
"hashed_secret": "dbfbf317dd33075578e4165b8741dc04cb833d78",
"is_verified": false,
"line_number": 71
"line_number": 71,
"is_secret": false
}
],
"test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v01.tsc": [
Expand All @@ -246,14 +224,16 @@
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v01.tsc",
"hashed_secret": "34af3d6f31b0b9c0d5bbbeb8d2e27a7623f8f481",
"is_verified": false,
"line_number": 72
"line_number": 72,
"is_secret": false
},
{
"type": "Email Address",
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v01.tsc",
"hashed_secret": "dbfbf317dd33075578e4165b8741dc04cb833d78",
"is_verified": false,
"line_number": 76
"line_number": 76,
"is_secret": false
}
],
"test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v02.tsc": [
Expand All @@ -262,14 +242,16 @@
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v02.tsc",
"hashed_secret": "34af3d6f31b0b9c0d5bbbeb8d2e27a7623f8f481",
"is_verified": false,
"line_number": 72
"line_number": 72,
"is_secret": false
},
{
"type": "Email Address",
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v02.tsc",
"hashed_secret": "dbfbf317dd33075578e4165b8741dc04cb833d78",
"is_verified": false,
"line_number": 76
"line_number": 76,
"is_secret": false
}
],
"test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v03.tsc": [
Expand All @@ -278,16 +260,60 @@
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v03.tsc",
"hashed_secret": "34af3d6f31b0b9c0d5bbbeb8d2e27a7623f8f481",
"is_verified": false,
"line_number": 72
"line_number": 72,
"is_secret": false
},
{
"type": "Email Address",
"filename": "test/data/naif3/spice_kernels/m2020_168_sclkscet_refit_v03.tsc",
"hashed_secret": "dbfbf317dd33075578e4165b8741dc04cb833d78",
"is_verified": false,
"line_number": 76
"line_number": 76,
"is_secret": false
}
],
"tests/test_utils.py": [
{
"type": "Hex High Entropy String",
"filename": "tests/test_utils.py",
"hashed_secret": "10a34637ad661d98ba3344717656fcc76209c2f8",
"is_verified": false,
"line_number": 49,
"is_secret": false
},
{
"type": "Hex High Entropy String",
"filename": "tests/test_utils.py",
"hashed_secret": "67a74306b06d0c01624fe0d0249a570f4d093747",
"is_verified": false,
"line_number": 50,
"is_secret": false
},
{
"type": "Basic Auth Credentials",
"filename": "tests/test_utils.py",
"hashed_secret": "25ab86bed149ca6ca9c1c0d5db7c9a91388ddeab",
"is_verified": false,
"line_number": 169,
"is_secret": false
},
{
"type": "Email Address",
"filename": "tests/test_utils.py",
"hashed_secret": "66ed46e8b325ac0c7982bd070c132bff14093bc3",
"is_verified": false,
"line_number": 169,
"is_secret": false
},
{
"type": "Email Address",
"filename": "tests/test_utils.py",
"hashed_secret": "fe5c714e9a30a923a58dac84e0af313c7fb7c553",
"is_verified": false,
"line_number": 179,
"is_secret": false
}
]
},
"generated_at": "2024-06-06T14:31:55Z"
"generated_at": "2024-08-14T16:02:14Z"
}
2 changes: 1 addition & 1 deletion docs/source/development/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The code base finally includes unit and functional tests. Once you've run
``venv/bin/pip install --editable '.[dev]'`` you can run the entire test suite
easily with::

venv/bin/pytest
venv/bin/tox -e py39


Making Releases
Expand Down
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
pythonpath = src
testpaths =
tests
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ zip_safe = True
include_package_data = True
packages = find_namespace:
python_requires = >= 3.9
test_suite = pds2.aipgen.tests.test_suite
package_dir =
= src

Expand Down Expand Up @@ -112,6 +111,7 @@ dev =
pytest-watch == 4.2.0 # Automatic testing every time you save a file
pytest-xdist == 2.4.0 # You got multiple cores, right?
pre-commit == 2.15.0 # Auto-run checks on every commit
tox ~= 4.11.0 # A way to automate and standardize testing in Python
types-requests ~= 2.31.0.20240218


Expand Down
41 changes: 0 additions & 41 deletions src/pds2/aipgen/tests/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/pds2/aipgen/tests/data

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions tests/data
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import unittest
from urllib.error import URLError

from .base import AIPFunctionalTestCase
from .base import SIPFunctionalTestCase
from base import AIPFunctionalTestCase
from base import SIPFunctionalTestCase


class LADEESIPTest(SIPFunctionalTestCase):
Expand Down
File renamed without changes.
24 changes: 24 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tox]
envlist = py39, docs, lint
isolated_build = True

[testenv]
deps = .[dev]
whitelist_externals = pytest
commands = pytest

[testenv:docs]
deps = .[dev]
whitelist_externals = python
commands = python setup.py build_sphinx

[testenv:lint]
deps = pre-commit
commands=
python -m pre_commit run --color=always {posargs:--all}
skip_install = true

[testenv:dev]
basepython = python3.9
usedevelop = True
deps = .[dev]

0 comments on commit 4370ff9

Please sign in to comment.