File tree Expand file tree Collapse file tree 4 files changed +66
-1
lines changed
examples/pdm-vcpkg-cmake/simple
tests/integration/examples Expand file tree Collapse file tree 4 files changed +66
-1
lines changed Original file line number Diff line number Diff line change 11MIT License
22
3- Copyright (c) 2021 Asher Norland
3+ Copyright (c) 2025 Synodic Software
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ """Integration tests for CPPython examples."""
Original file line number Diff line number Diff line change 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 ()
You can’t perform that action at this time.
0 commit comments