Skip to content

Commit

Permalink
Remove all remnants of nose testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-blanchard committed Oct 7, 2020
1 parent bffec2a commit f3e1cb6
Show file tree
Hide file tree
Showing 16 changed files with 97 additions and 185 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ group: edge
language: python
sudo: false
cache:
directories:
- $HOME/.cache/pip
pip: true
python:
- "3.6"
- "3.7"
Expand Down
9 changes: 5 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[nosetests]
logging-clear-handlers = 1
verbosity = 2
detailed-errors = 1
[bdist_wheel]
universal=1

[tool:pytest]
addopts = --doctest-modules --ignore=examples/ --ignore=doc/ --ignore=setup.py
2 changes: 0 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
graphviz
mock; python_version < '3'
unittest2; python_version < '3'
pytest
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_jar.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.jar import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class JARTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("jar" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "jar" in subcommands
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_kill.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.kill import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class KillTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("kill" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "kill" in subcommands
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.list import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class ListTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("list" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "list" in subcommands
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.quickstart import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class QuickStartTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("quickstart" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "quickstart" in subcommands
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_remove_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.remove_logs import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class RemoveLogsTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("remove_logs" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "remove_logs" in subcommands
46 changes: 20 additions & 26 deletions test/streamparse/cli/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,31 @@
import unittest
from unittest.mock import patch

from nose.tools import ok_

from streamparse.cli.run import main, subparser_hook


class RunTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("run" in subcommands)
def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

@patch("streamparse.cli.run.run_local_topology", autospec=True)
def test_main_args_passed(self, run_local_mock):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)
subcommands = parser._optionals._actions[1].choices.keys()
assert "run" in subcommands

args = parser.parse_args("run -e my_env -n my_topo --ackers 1".split())

main(args)
run_local_mock.assert_called_with(
name="my_topo",
options={"topology.acker.executors": 1},
env_name="my_env",
time=0,
config_file=None,
)
@patch("streamparse.cli.run.run_local_topology", autospec=True)
def test_main_args_passed(run_local_mock):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

args = parser.parse_args("run -e my_env -n my_topo --ackers 1".split())

if __name__ == "__main__":
unittest.main()
main(args)
run_local_mock.assert_called_with(
name="my_topo",
options={"topology.acker.executors": 1},
env_name="my_env",
time=0,
config_file=None,
)
23 changes: 8 additions & 15 deletions test/streamparse/cli/test_sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@

from streamparse.cli import sparse

from nose.tools import ok_


class SparseTestCase(unittest.TestCase):
def test_load_subparsers(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
sparse.load_subparsers(subparsers)
# grab subcommands from subparsers
subcommands = parser._optionals._actions[1].choices.keys()
# we know quickstart will be a subcommand test others as needed
ok_("quickstart" in subcommands)


if __name__ == "__main__":
unittest.main()
def test_load_subparsers():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
sparse.load_subparsers(subparsers)
# grab subcommands from subparsers
subcommands = parser._optionals._actions[1].choices.keys()
# we know quickstart will be a subcommand test others as needed
assert "quickstart" in subcommands
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.stats import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class StatsTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("stats" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "stats" in subcommands
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.submit import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class SubmitTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("submit" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "submit" in subcommands
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_tail.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.tail import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class TailTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("tail" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "tail" in subcommands
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_update_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.update_virtualenv import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class UpdateVirtualenvTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("update_virtualenv" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "update_virtualenv" in subcommands
19 changes: 6 additions & 13 deletions test/streamparse/cli/test_worker_uptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@

from streamparse.cli.worker_uptime import subparser_hook

from nose.tools import ok_

def test_subparser_hook():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

class WorkerUptimeTestCase(unittest.TestCase):
def test_subparser_hook(self):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser_hook(subparsers)

subcommands = parser._optionals._actions[1].choices.keys()
ok_("worker_uptime" in subcommands)


if __name__ == "__main__":
unittest.main()
subcommands = parser._optionals._actions[1].choices.keys()
assert "worker_uptime" in subcommands
9 changes: 3 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
# and then run "tox" from this directory.

[tox]
envlist = py27, py33, py34, pypy
envlist = py36, py37, py38, py39, pypy3

[testenv]
deps =
deps =
-rrequirements.txt
-rtest-requirements.txt
commands = nosetests -v --logging-level=DEBUG
commands = py.test -v --logging-level=DEBUG

[testenv:flake8]
deps = flake8
commands = flake8 streamparse test

0 comments on commit f3e1cb6

Please sign in to comment.