Coder Social home page Coder Social logo

tapestry's Introduction

tapestry minimal curses Python wrapper

python tests

This Python package provides a set of minimal wrappers around the default curses library included with Python.

It's meant to provide an easier interface for building applications quickly.

It also provides some testing code that demonstrate some useful patterns:

  • Testing curses and other code that use custom terminal calls, this includes duplicating stdout and other file descriptors and restoring them after tests run.
  • Use of context managers to wrap tests and other code and ensure proper setup and cleanup.
  • Writing callbacks as inner functions to make testing code easier to understand.

Some of the code closely follows code in the CPython project, specically the test_curses.py file provides excellent examples of duplicating file descriptors.

Usage

First, most functions that take coordinates have the x coordinate first, followed by the y coordinate. This differs from the default curses library where the y coordinate is usually first.

Example:

PYTHONPATH=. python examples/simple.py

Development

This project uses pytest for tests.

pipenv is used to manage this project:

To install dependencies and start developing:

$ pipenv install --dev $ pipenv shell

Testing

$ pipenv run python -m pytest

or

$ pipenv run python -m pytest --capture=no

tapestry's People

Contributors

jgerrish avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.