GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pythonnet/tests/test_import.py at master · pythonnet/pythonnet

Expand file tree

/

test_import.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
27 lines (20 loc) · 814 Bytes
/

test_import.py

Copy path

File metadata and controls

27 lines (20 loc) · 814 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
26
27
# -*- coding: utf-8 -*-
"""Test the import statement."""
import pytest
import sys
# Unused import to preload the class
#
# This resulted in the FileStream name missing from the wildcard import later
from System.IO import FileStream # noqa: F401
def test_relative_missing_import():
"""Test that a relative missing import doesn't crash.
Some modules use this to check if a package is installed.
Relative import in the site-packages folder"""
with pytest.raises(ImportError):
from . import _missing_import
def test_import_all_on_second_time():
"""Test import all attributes after a normal import without '*'.
Due to import * only allowed at module level, the test body splitted
to a module file."""
from . import importtest
del sys.modules[importtest.__name__]
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.