nixpkgs/pkgs/by-name/gp/gphotos-sync/skip-network-tests.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

22 lines
796 B
Diff

diff --git a/tests/test_setup.py b/tests/test_setup.py
index 085b110..ea4a7d2 100644
--- a/tests/test_setup.py
+++ b/tests/test_setup.py
@@ -45,7 +45,8 @@ class SetupDbAndCredentials:
return self
def __exit__(self, exc_type=None, exc_value=None, traceback=None):
- self.gp.google_photos_down.close()
+ if hasattr(self.gp, 'google_photos_down'):
+ self.gp.google_photos_down.close()
def test_setup(self, test_name, args=None, trash_db=False, trash_files=False):
self.root = Path("/tmp/gpTests/{}".format(test_name))
@@ -76,3 +77,6 @@ class SetupDbAndCredentials:
def test_done(self):
self.gp.data_store.store()
+
+import pytest, requests
+requests.Session.__init__ = lambda *args, **kwargs: pytest.skip("no network access")