Skip to content

Commit 4f2bd46

Browse files
committed
Add First Example
1 parent 20938a2 commit 4f2bd46

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Asher Norland
3+
Copyright (c) 2025 Synodic Software
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[project]
2+
description = "A simple project showing how to use vcpkg with CPPython"
3+
name = "cppython-vcpkg-simple"
4+
5+
license = {text = "MIT"}
6+
7+
authors = [
8+
{name = "Synodic Software", email = "contact@synodic.software"},
9+
]
10+
11+
requires-python = ">=3.13"
12+
13+
dependencies = [
14+
"cppython>=0.1.0",
15+
]
16+
17+
[tool.pdm]
18+
distribution = false
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Integration tests for CPPython examples."""
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""Example folder tests"""
2+
3+
from os import walk
4+
from pathlib import Path
5+
from typing import cast
6+
7+
import pytest
8+
9+
10+
class TestExamples:
11+
"""Tests to apply to all examples"""
12+
13+
@staticmethod
14+
def _examples() -> list[Path]:
15+
"""Returns the examples directory"""
16+
matching_directories = []
17+
18+
for dirpath, _, filenames in walk('examples'):
19+
for filename in filenames:
20+
if filename == 'pyproject.toml':
21+
matching_directories.append(Path(dirpath))
22+
break
23+
24+
return matching_directories
25+
26+
@staticmethod
27+
@pytest.fixture(
28+
name='example_directory',
29+
scope='session',
30+
params=_examples(),
31+
)
32+
def fixture_example_directory(
33+
request: pytest.FixtureRequest,
34+
) -> Path:
35+
"""Enumerates folders in the examples directory.
36+
37+
Parameterizes all directories with a pyproject.toml file within the examples directory.
38+
"""
39+
directory = cast(Path, request.param)
40+
return directory
41+
42+
@staticmethod
43+
def test_example(example_directory: Path) -> None:
44+
"""Tests the examples"""
45+
assert example_directory.is_dir()
46+
assert (example_directory / 'pyproject.toml').is_file()

0 commit comments

Comments
 (0)