File: test_examples.py

package info (click to toggle)
python-atom 0.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,616 kB
  • sloc: cpp: 9,040; python: 6,249; makefile: 123
file content (25 lines) | stat: -rw-r--r-- 844 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# --------------------------------------------------------------------------------------
# Copyright (c) 2020-2024, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# --------------------------------------------------------------------------------------
"""Test the examples."""

import os
import runpy

import pytest

example_folder = os.path.join(os.path.dirname(__file__), "..", "examples")
examples = []
for dirpath, dirnames, filenames in os.walk(example_folder):
    examples += [os.path.join(dirpath, f) for f in filenames]


@pytest.mark.parametrize("path", examples)
def test_example(path):
    if "pickling" in path:
        pytest.skip("Example requires to be executed as a top level module")
    runpy.run_path(path)