Skip to content

Commit

Permalink
Remove unittest dependency (#431)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandra Belousov <sashabelousovrh@Alexandras-MacBook-Pro.local>
  • Loading branch information
BelSasha and Alexandra Belousov authored Feb 7, 2024
1 parent 89b8a37 commit d454d97
Show file tree
Hide file tree
Showing 26 changed files with 307 additions and 355 deletions.
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pytest
pytest-mock
httpx
pytest_asyncio
pytest-mock
datasets
dask
tqdm
Expand Down
6 changes: 0 additions & 6 deletions tests/test_den/test_defaults.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import unittest

import pytest

import runhouse as rh
Expand All @@ -14,7 +12,3 @@ def test_download_defaults():
loaded_defaults = rh.configs.download_defaults()
assert local_defaults == loaded_defaults
assert rh.globals.rns_client.default_folder == "nonsense"


if __name__ == "__main__":
unittest.main()
7 changes: 1 addition & 6 deletions tests/test_den/test_rns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import unittest
from pathlib import Path

import pytest
Expand Down Expand Up @@ -54,7 +53,7 @@ def test_rns_path(tmp_path):
)


@unittest.skip(
@pytest.mark.skip(
"TODO: [DG] This whole business is hanging on by a thread, we need to overhaul it."
)
def test_ls():
Expand Down Expand Up @@ -87,7 +86,3 @@ def test_from_name(ondemand_cpu_cluster):
f = rh.folder(name="~/tests/bert_ft")
assert f.path
assert ondemand_cpu_cluster.instance_type == "CPU:2+"


if __name__ == "__main__":
unittest.main()
5 changes: 0 additions & 5 deletions tests/test_login.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import unittest

import runhouse as rh
import sky
Expand Down Expand Up @@ -57,7 +56,3 @@ def test_login_flow_in_new_env():

secrets_in_vault = rh.Secret.vault_secrets(headers=headers)
assert not secrets_in_vault


if __name__ == "__main__":
unittest.main()
5 changes: 0 additions & 5 deletions tests/test_obj_store.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import time
import unittest

import numpy as np

Expand Down Expand Up @@ -223,7 +222,3 @@ def test_tqdm_streaming(cluster):
print_fn = rh.function(fn=do_tqdm_printing_and_logging).to(cluster, env=["tqdm"])
res = print_fn(steps=40, stream_logs=True)
assert res == list(range(50))


if __name__ == "__main__":
unittest.main()
5 changes: 0 additions & 5 deletions tests/test_performance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import time
import unittest

import pytest
import requests
Expand Down Expand Up @@ -56,7 +55,3 @@ def test_roundtrip_performance(summer_func):
@pytest.mark.rnstest
def test_https_roundtrip_performance(summer_func_with_auth):
run_performance_tests(summer_func_with_auth)


if __name__ == "__main__":
unittest.main()
5 changes: 0 additions & 5 deletions tests/test_resources/test_clusters/cluster_tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import copy
import unittest
from pathlib import Path

import pytest
Expand Down Expand Up @@ -196,7 +195,3 @@ def test_start_server_with_custom_certs(

Path(resolve_absolute_path(ssl_certfile)).unlink()
Path(resolve_absolute_path(ssl_keyfile)).unlink()


if __name__ == "__main__":
unittest.main()
5 changes: 0 additions & 5 deletions tests/test_resources/test_clusters/test_pwd_cluster.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import unittest

from tests.conftest import docker_cluster_pwd_ssh_no_auth, password_cluster
from tests.test_obj_store import (
Expand All @@ -19,7 +18,3 @@
UNIT = {"cluster": [docker_cluster_pwd_ssh_no_auth]}
LOCAL = {"cluster": [docker_cluster_pwd_ssh_no_auth]}
MINIMAL = {"cluster": [password_cluster, docker_cluster_pwd_ssh_no_auth]}


if __name__ == "__main__":
unittest.main()
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import unittest

import pytest

Expand Down Expand Up @@ -97,4 +96,4 @@ def test_stable_diffusion_on_sm_gpu(sm_gpu_cluster):


if __name__ == "__main__":
unittest.main()
pytest.main()
5 changes: 0 additions & 5 deletions tests/test_resources/test_modules/test_blobs/test_blob.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import unittest
from pathlib import Path

import pytest
Expand Down Expand Up @@ -118,7 +117,3 @@ def test_load_shared_blob(local_blob):
reloaded_data = my_blob.fetch()
# NOTE: we need to do the deserialization ourselves
assert str(reloaded_data) == str(local_blob.fetch())


if __name__ == "__main__":
unittest.main()
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import subprocess
import unittest
from pathlib import Path

import pytest
Expand Down Expand Up @@ -325,7 +324,3 @@ def test_install_cmd_for_torch_on_cluster(request, ondemand_cluster):
assert (
sent_to_cuda
), f"Failed to send torch tensor to CUDA on {ondemand_cluster.name}"


if __name__ == "__main__":
unittest.main()
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import os
import unittest
from pathlib import Path

import boto3
Expand Down Expand Up @@ -377,4 +376,4 @@ def test_delete_lambda():


if __name__ == "__main__":
unittest.main()
pytest.main()
Loading

0 comments on commit d454d97

Please sign in to comment.