Skip to content

Commit

Permalink
Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
benedekrozemberczki committed Jun 10, 2020
1 parent 8ca0bfb commit 9af05e5
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
source=karatecluv
[report]
exclude_lines =
pragma: no cover
raise
except
register_parameter
warn
pass
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: shell

os:
- linux
- osx
- windows

env:
jobs:
- PYTHON_VERSION=3.6

install:
- source script/conda.sh
- conda create --yes -n test python="${PYTHON_VERSION}"
- source activate test
- pip install codecov
- python setup.py install

script:
- python setup.py test

after_success:
- codecov

notifications:
email: false

26 changes: 26 additions & 0 deletions script/conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b
PATH=/home/travis/miniconda3/bin:${PATH}
fi

if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b
PATH=/Users/travis/miniconda3/bin:${PATH}
fi


if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
choco install openssl.light
choco install miniconda3
PATH=/c/tools/miniconda3/Scripts:$PATH
fi

conda update --yes conda

conda create --yes -n test python="${PYTHON_VERSION}"
9 changes: 9 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
[metadata]
description-file = README.md

[aliases]
test=pytest

[tool:pytest]
addopts = --capture=no --cov



19 changes: 19 additions & 0 deletions test/generic_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import networkx as nx

from karateclub import DeepWalk

def test_sampler():
"""
Testing the sampler base class.
"""
model = DeepWalk()

graph = nx.watts_strogatz_graph(200, 10, 0)

model.fit(graph)

embedding = model.get_embedding()

assert embedding.shape[1] = model.dimensions


0 comments on commit 9af05e5

Please sign in to comment.