Skip to content

pip install fix. #237

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

Merged
merged 8 commits into from
Nov 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ matrix:
# command to install dependencies
install:
- pip install -r tests/ci_requirements.txt
- pip install . -U
before_script:
- cp ./tests/example_config ./tests/config
# Run flake and then run tests
script:
- if [ -n "$RUN_FLAKE" = true ]; then flake8; fi
- coverage run -m nose --config="nose.cfg"
- cd tests && coverage run -m nose --no-path-adjustment
after_success: coveralls
notifications:
email:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
packages=find_packages(exclude=('tests',)),
script_args=script_args,
include_package_data=True,
package_data={'': ['cacerts.txt']},
package_data={'': ['cacerts.txt', 'cacert.pem']},
zip_safe=False,
)
6 changes: 3 additions & 3 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
def skip(f):
return lambda self: None

CONFIG_PATH = 'tests/config'


class TestBase(unittest.TestCase):
'''Base class for tests.
Expand Down Expand Up @@ -57,7 +55,9 @@ def setUpClass(cls):
# Since the file is read and never modified, we will only read
# it once in memory and be done.
cls.config = SgTestConfig()
cls.config.read_config(CONFIG_PATH)
cur_folder = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(cur_folder, "config")
cls.config.read_config(config_path)

def setUp(self, auth_mode='ApiUser'):
self.human_login = self.config.human_login
Expand Down
4 changes: 3 additions & 1 deletion tests/run_appveyor.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@

copy tests\example_config tests\config
%PYTHON%\Scripts\pip install -r tests/ci_requirements.txt
%PYTHON%\Scripts\nosetests.exe -v --config="nose.cfg"
%PYTHON%\Scripts\pip install . -U
cd tests
%PYTHON%\Scripts\nosetests.exe -v --no-path-adjustment
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

from . import base

THUMBNAIL_MAX_ATTEMPTS = 12
THUMBNAIL_MAX_ATTEMPTS = 18
THUMBNAIL_RETRY_INTERAL = 5
TRANSIENT_IMAGE_PATH = "images/status/transient"

Expand Down
7 changes: 5 additions & 2 deletions tests/tests_unit.py → tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,12 @@ def test_found_correct_cert(self):
isn't set), is the one bundled with this API
"""
# Get the path to the cert file we expect the Shotgun API to find
cur_path = os.path.dirname(os.path.abspath(__file__))
cert_path = os.path.normpath(
os.path.join(cur_path, "..", "shotgun_api3", "lib", "certifi", "cacert.pem")
# Get the path relative to where we picked up the API and not relative
# to file on disk. On CI we pip install the API to run the tests
# so we have to pick the location from the installed copy.
# Call dirname to remove from __init__.py
os.path.join(os.path.dirname(api.__file__), "lib", "certifi", "cacert.pem")
)
# Now ensure that the path the SG API has found is correct.
self.assertEquals(cert_path, self.certs)
Expand Down