Skip to content

Commit 187a57f

Browse files
authored
TST: mock job_id for g-c-bq 0.29 tests. pin g-c-bq version for conda build (#169)
* TST: add mocked job_id for google-cloud-bigquery 0.29 Closes GH#168. * TST: upgrade setuptools for namespace package support * TST: upgrade pip for namespace package breakage. * TST: remove pip commands from conda test environment * TST: remove another pip command from conda tests * TST: add setuptools to conda installation * TST: add explicit google-api-core dep to conda build * TST: pin miniconda to specific version * TST: pin google-cloud-bigquery in conda build
1 parent 8f49ec3 commit 187a57f

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.travis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ install:
1717
# https://github.com/pre-commit/pre-commit/commit/e3ab8902692e896da9ded42bd4d76ea4e1de359d
1818
- pyenv install -s $PYENV_VERSION
1919
- pyenv global system $PYENV_VERSION
20+
# Upgrade setuptools and pip to work around
21+
# https://github.com/pypa/setuptools/issues/885
22+
- pip install --upgrade setuptools
23+
- pip install --upgrade pip
2024
- REQ="ci/requirements-${PYTHON}-${PANDAS}" ;
2125
if [ -f "$REQ.pip" ]; then
2226
pip install --upgrade nox-automation ;
2327
else
24-
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
28+
wget http://repo.continuum.io/miniconda/Miniconda3-4.3.30-Linux-x86_64.sh -O miniconda.sh;
2529
bash miniconda.sh -b -p $HOME/miniconda ;
2630
export PATH="$HOME/miniconda/bin:$PATH" ;
2731
hash -r ;
@@ -32,8 +36,8 @@ install:
3236
conda info -a ;
3337
conda create -q -n test-environment python=$PYTHON ;
3438
source activate test-environment ;
39+
conda install -q setuptools ;
3540
conda install -q pandas=$PANDAS;
36-
pip install coverage pytest pytest-cov flake8 codecov ;
3741
conda install -q --file "$REQ.conda";
3842
conda list ;
3943
python setup.py install ;
@@ -45,7 +49,6 @@ script:
4549
- if [[ $PYTHON == '3.6' ]] && [[ "$PANDAS" == "MASTER" ]]; then nox -s test36master ; fi
4650
- REQ="ci/requirements-${PYTHON}-${PANDAS}" ;
4751
if [ -f "$REQ.conda" ]; then
48-
pip install pytest ;
4952
pytest -v tests ;
5053
fi
5154
- if [[ $COVERAGE == 'true' ]]; then nox -s cover ; fi

ci/requirements-3.6-0.20.1.conda

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
google-auth
22
google-auth-oauthlib
3-
google-cloud-bigquery
3+
google-cloud-bigquery==0.32.0
4+
pytest
5+
pytest-cov
6+
codecov
7+
coverage
8+
flake8

tests/unit/test_gbq.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def mock_bigquery_client(monkeypatch):
2020
mock_client = mock.create_autospec(google.cloud.bigquery.Client)
2121
# Mock out SELECT 1 query results.
2222
mock_query = mock.create_autospec(google.cloud.bigquery.QueryJob)
23+
mock_query.job_id = 'some-random-id'
2324
mock_query.state = 'DONE'
2425
mock_rows = mock.create_autospec(
2526
google.cloud.bigquery.table.RowIterator)

0 commit comments

Comments
 (0)