Skip to content

Commit

Permalink
fix biomart flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
cokelaer committed Jan 27, 2025
1 parent 26dd535 commit fa0dc95
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Publish to PyPI
on:
on:
workflow_dispatch:
push:
tags:
Expand All @@ -11,19 +11,19 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@main
- name: Set up Python 3.7
uses: actions/setup-python@v1
- name: Set up Python '3.10'
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: '3.10'

- name: Install package
run: |
pip install build
pip install build poetry
- name: Build source tarball
run: |
rm -rf dist;
python setup.py sdist
poetry build
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
23 changes: 10 additions & 13 deletions test/webservices/test_biomart.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,51 +25,48 @@ def _test_datasets(biomart):


@pytest.mark.flaky
def _test_attributes(biomart):
def test_attributes(biomart):
assert "oanatinus_gene_ensembl" in biomart.valid_attributes[biomart.mart_test]


@pytest.mark.flaky
def test_filters(biomart):
biomart = BioMart(host="www.ensembl.org", verbose=False)
biomart.mart_test = "ENSEMBL_MART_ENSEMBL"
try:
biomart.filters("oanatinus_gene_ensembl")
except:
biomart.filters("oanatinus_genomic_sequence")
biomart.filters("oanatinus_gene_ensembl")


@pytest.mark.flaky
def test_config(biomart):
biomart.configuration("oanatinus_genomic_sequence")
biomart.configuration("oanatinus_gene_ensembl")


# fails on travais sometines
# fails sometines
@pytest.mark.flaky
def _test_query(biomart):
res = biomart.query(biomart._xml_example)
assert "ENSMUS" in res


@pytest.mark.flaky
def test_xml(biomart):
def test_xml():
biomart = BioMart(host="www.ensembl.org", verbose=False)
biomart.mart_test = "ENSEMBL_MART_ENSEMBL"
# build own xml using the proper functions
biomart.add_dataset_to_xml("mmusculus_gene_ensembl")
biomart.get_xml()


@pytest.mark.flaky
def test_biomart_constructor():
def _test_biomart_constructor():
s = BioMart()
try:
s.registry()
except:
pass
try:
s.host = "dummy"
except:
except ConnectionError:
pass
s.host = "www.ensembl.org"
# s.host = "www.ensembl.org"


# # reactome not maintained anymore ?
Expand Down

0 comments on commit fa0dc95

Please sign in to comment.