Skip to content

Commit 89350ac

Browse files
committed
make py3.5 compliant
1 parent 7642202 commit 89350ac

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

Makefile

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ endif
2020

2121
TEST_ENV =
2222

23+
RSC_API_KEYS=vetiver-testing/rsconnect_api_keys.json
24+
2325
ifneq ($(CONNECT_SERVER),)
2426
TEST_ENV += CONNECT_SERVER=$(CONNECT_SERVER)
2527
endif
@@ -173,11 +175,11 @@ promote-docs-in-s3:
173175
s3://docs.rstudio.com/rsconnect-python/
174176

175177

176-
dev: vetiver/tests/rsconnect_api_keys.json
178+
dev: vetiver-testing/rsconnect_api_keys.json
177179

178180
dev-start:
179181
docker-compose up -d
180-
docker-compose exec -T rsconnect bash < script/setup-rsconnect/add-users.sh
182+
docker-compose exec -T rsconnect bash < vetiver-testing/setup-rsconnect/add-users.sh
181183
# curl fails with error 52 without a short sleep....
182184
sleep 5
183185
curl -s --retry 10 --retry-connrefused http://localhost:3939
@@ -187,4 +189,5 @@ dev-stop:
187189
rm -f $(RSC_API_KEYS)
188190

189191
$(RSC_API_KEYS): dev-start
190-
python script/setup-rsconnect/dump_api_keys.py $@
192+
python vetiver-testing/setup-rsconnect/dump_api_keys.py $@
193+

conftest.py

+15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
import sys
2+
import pytest
23

34
from os.path import abspath, dirname
45

56

67
HERE = dirname(abspath(__file__))
78
sys.path.insert(0, HERE)
9+
10+
11+
def pytest_addoption(parser):
12+
parser.addoption(
13+
"--vetiver", action="store_true", default=False, help="run vetiver tests"
14+
)
15+
16+
def pytest_configure(config):
17+
config.addinivalue_line("markers", "vetiver: test for vetiver interaction")
18+
19+
def pytest_collection_modifyitems(config, items):
20+
if config.getoption("--vetiver"):
21+
return
22+
skip_vetiver = pytest.mark.skip(reason="need --vetiver option to run")

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ services:
88
ports:
99
- 3939:3939
1010
volumes:
11-
- $PWD/script/setup-rsconnect/users.txt:/etc/users.txt
12-
- $PWD/script/setup-rsconnect/rstudio-connect.gcfg:/etc/rstudio-connect/rstudio-connect.gcfg
11+
- $PWD/vetiver-testing/setup-rsconnect/users.txt:/etc/users.txt
12+
- $PWD/vetiver-testing/setup-rsconnect/rstudio-connect.gcfg:/etc/rstudio-connect/rstudio-connect.gcfg
1313
# by default, mysql rounds to 4 decimals, but tests require more precision
1414
privileged: true
1515
environment:

tests/test_vetiver_pins.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from rsconnect.api import RSConnectServer, RSConnectClient # noqa
1414

1515
RSC_SERVER_URL = "http://localhost:3939"
16-
RSC_KEYS_FNAME = "vetiver/tests/rsconnect_api_keys.json"
16+
RSC_KEYS_FNAME = "vetiver-testing/rsconnect_api_keys.json"
1717

1818
pytestmark = pytest.mark.vetiver # noqa
1919

@@ -85,7 +85,7 @@ def test_deploy(rsc_short):
8585
rsc_api = list(filter(lambda x: x["title"] == "testapivetiver", dicts))
8686
content_url = rsc_api[0].get("content_url")
8787

88-
h = {"Authorization": f'Key {get_key("susan")}'}
88+
h = {"Authorization": 'Key {}'.format(get_key("susan"))}
8989

9090
endpoint = vetiver.vetiver_endpoint(content_url + "/predict")
9191
response = vetiver.predict(endpoint, X_df, headers=h)

0 commit comments

Comments
 (0)