diff --git a/plotid/publish.py b/plotid/publish.py
index 8912a2a4100be4b14a79c680c3cbc084580e6810..a6034ab3f8bf3368a5b2815b86dc3a67cc460877 100644
--- a/plotid/publish.py
+++ b/plotid/publish.py
@@ -74,9 +74,8 @@ class PublishOptions:
 
         if not os.path.isfile(sys.argv[0]):
             raise FileNotFoundError(
-                "Cannot copy original python script. "
-                "Running publish from a shell is not "
-                "possible."
+                "Cannot copy original python script. Running publish from a shell is "
+                "not possible."
             )
 
         # Check if self.src_datapaths are strings and existing files.
diff --git a/tests/test_publish.py b/tests/test_publish.py
index f279f7f0b9232689dc9599d277c94c6fc7c7ea04..1f779deb434335b31f8e5543517221806bcc3f73 100644
--- a/tests/test_publish.py
+++ b/tests/test_publish.py
@@ -45,8 +45,7 @@ class TestPublish(unittest.TestCase):
     # Skip test if tests are run from command line.
     @unittest.skipIf(
         not os.path.isfile(sys.argv[0]),
-        "Publish is not called "
-        "from a Python script. Therefore, the script cannot be "
+        "Publish is not called from a Python script. Therefore, the script cannot be "
         "copied.",
     )
     def test_publish(self):
@@ -112,6 +111,12 @@ class TestPublish(unittest.TestCase):
         with self.assertRaises(TypeError):
             publish(PlotIDTransfer(FIG, ["i", 4]), SRC_DIR, DST_PATH)
 
+    # Skip test if tests are run from command line.
+    @unittest.skipIf(
+        not os.path.isfile(sys.argv[0]),
+        "Publish is not called from a Python script. Therefore, the script cannot be "
+        "copied.",
+    )
     def test_publish_multiple_src_files(self):
         """
         Test publish with multiple source files and check
@@ -137,6 +142,12 @@ class TestPublish(unittest.TestCase):
         with self.assertRaises(FileNotFoundError):
             publish(FIGS_AND_IDS, "not_existing_folder", DST_PATH)
 
+    # Skip test if tests are run from command line.
+    @unittest.skipIf(
+        not os.path.isfile(sys.argv[0]),
+        "Publish is not called from a Python script. Therefore, the script cannot be "
+        "copied.",
+    )
     def test_src_directory_type(self):
         """Test if Error is raised when source directory is not a string."""
         with self.assertRaises(TypeError):
@@ -260,8 +271,7 @@ class TestPublish(unittest.TestCase):
     # Skip test if tests are run from command line.
     @unittest.skipIf(
         not os.path.isfile(sys.argv[0]),
-        "Publish is not called "
-        "from a Python script. Therefore, the script cannot be "
+        "Publish is not called from a Python script. Therefore, the script cannot be "
         "copied.",
     )
     def test_dst_invisible_already_exists(self):
@@ -290,6 +300,12 @@ class TestPublish(unittest.TestCase):
         with self.assertRaises(TypeError):
             publish(FIGS_AND_IDS, SRC_DIR, DST_PATH, ["test", 3])
 
+    # Skip test if tests are run from command line.
+    @unittest.skipIf(
+        not os.path.isfile(sys.argv[0]),
+        "Publish is not called from a Python script. Therefore, the script cannot be "
+        "copied.",
+    )
     def test_data_storage(self):
         """
         Test if Error is raised when unsupported storage method was chosen.