Click & Jump to Test Failures from the Command Line (iTerm2)
Skills:
Tool Use & Function Calling80%
Key Takeaways
The video demonstrates how to use iTerm2 to click and jump to test failures from the command line, and how to configure this feature to open files in a favorite editor.
Full Transcript
hey folks is Daniel here with another Python developer tip so I've got I term to here which is the terminal emulator that I use on my Mac and it's got a super super handy feature that allows you to click on any file name in the terminal and an open at in your favorite editor so check this out I've got a Python project here and I'm gonna kick off a test run with PI tests and before I started the recording I actually broke one of the tests and I get this wonderful printout from PI test right and now what I can do I can hit press down command and then click on that file name with the line number and what's gonna happen is that I term actually opens that file in my editor which in my case is sublime text 3 and it bounces me directly to the failed test case so did you see that right just command click into I term 2 and it's gonna open that file directly on that failed assertion based on the line number it can fix my test and run it again so this is a super super handy feature if you're running Python test from the command line like I do like it's kind of my workflow and it took just cuts down on the time that you need to actually find these test failures and then fix them now the cool thing is it doesn't just stop there so I can just do that with any file name right it doesn't have to be part of a test failure so even if I just run the LS command to list my files I can just click on any of those files and they're gonna be opened in the editor that I have configured which is super super useful it has another feature where if you click on a folder or directory it's actually going to open that folder in finder so you can browse it and I use that feature all the time it is so handy and now I'm gonna show you how to actually configure that so what you want to do is you want to open the preferences for item 2 and then click on profiles and then go all the way to the right to the Advanced tab from there you want to go to the bit that says semantic history and you want to use these settings so I have to set to open with editor and then I just picked my editor of choice which in my case is sublime text 3 so you can you know pick any editor that's in your Applications folder and it's just gonna gonna work and well then you close the Preferences and you're ready to go just try this feature out out it's actually really easy to setup once you find this setting which took me I know like a year to actually realize that I term 2 could do this and I was really glad I found this so I think I term 2 is actually a really great program that I use well basically every day in my development workflow and I probably gonna do more videos about that so if you're interested in this topic you want to learn more tips like that then either subscribe to my channel or actually go to debate org slash newsletter where which is my website I have a ton of free stuff for Python developers tutorials and videos just like the one you just watched and if you want to go there then and sign up for a newsletter and you're never gonna miss out on another video and I'd love to stay in touch with you cool thanks so much for listening I hope this was helpful have a great day
Original Description
iTerm2 has a little known feature that lets you open a file in your favorite editor simply by clicking on a file name in the terminal.
This also works with folders (they'll open in Finder) – and it is a super handy feature if you're running your Python tests from the command line. I use it all the time to click and jump to failed test cases with the Pytest test runner, for example.
(This feature should be completely language agnostic by the way. So you'll be able to use it with any test runner or language.)
The feature is called "Semantic History" and configuring it will let you Cmd+Click on any file or folder name to open it from the terminal.
Watch the video to learn how to set everything up :)
* * *
Shameless plug: If you want to get a Sublime Text setup just like the one in the video then check out my Sublime Text Setup Guide for Python Developers: https://SublimeTextPython.com 😊
► Weekly Tips for Python Developers: https://dbader.org/newsletter
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Real Python · Real Python · 19 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
▶
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
A better Python REPL – bpython vs python interpreter
Real Python
Introducing large-type.com – A Utility Website
Real Python
Reading Hacker News Without Wasting Tons of Time
Real Python
Forward References and Python 3 Type Hints
Real Python
Using Sublime Text as your Git Editor
Real Python
Python Code Linting and Auto-Complete for Sublime Text
Real Python
Make your Python Code More Readable with Custom Exceptions
Real Python
Write Better Tests with Sublime Text's Split Layout Feature
Real Python
How to Use Sublime Text from the Command Line
Real Python
Rename Variables with Multiple Selection in Sublime Text
Real Python
Sublime Text Settings for Writing PEP 8 Python
Real Python
Write Cleaner Python with Sublime Text's Indent Guides
Real Python
Sublime Text Whitespace Settings for Python Development
Real Python
Function Argument Unpacking in Python
Real Python
Python Code Review: Debugging and Refactoring "Conway's Game of Life" + Automated Tests
Real Python
Using "get()" to Return a Default Value from a Python Dict
Real Python
A Python Shorthand for Swapping Two Variables
Real Python
Python Code Review: Refactoring a Web Scraper, PEP 8 Style Guide Compliance, requirements.txt
Real Python
Click & Jump to Test Failures from the Command Line (iTerm2)
Real Python
Setting up Sublime Text for Python Developers
Real Python
Sublime Text + Python Guide Overview
Real Python
Python Code Review: Adding Pytest Tests to an Existing Python Web Scraper
Real Python
Type-Checking Python Programs With Type Hints and mypy
Real Python
A Shorthand for Merging Dictionaries in Python 3.5+
Real Python
Python Code Review Flask Web Security Tutorial + Virtualenvs, requirements.txt
Real Python
My Python Code Looks Ugly and Confusing – Help!
Real Python
Setting Up a Programmer Portfolio/Developer Blog – How To Get Started
Real Python
Do I Need a GitHub/GitLab/Bitbucket Profile as a Developer?
Real Python
Programmer Portfolio – Example and Walkthrough
Real Python
How to Get Your 1st Speaking Gig at a Tech Conference
Real Python
How to Build Your Public Speaking Skills as a Developer
Real Python
The Object-oriented Version of "Spaghetti Code" is "Lasagna Code" ?!
Real Python
Setting up Sublime Text for Python Developers – Lesson #1
Real Python
Cool New Features in Python 3.6
Real Python
"is" vs "==" in Python – What's the Difference? (And When to Use Each)
Real Python
Emulating switch/case Statements in Python with Dictionaries
Real Python
Python Function Argument Unpacking Tutorial (* and ** Operators)
Real Python
What Code Should I Put On My GitHub/GitLab/BitBucket Profile?
Real Python
A Crazy Python Dictionary Expression ?!
Real Python
String Conversion in Python: When to Use __repr__ vs __str__
Real Python
Method Types in Python OOP: @classmethod, @staticmethod, and Instance Methods
Real Python
Optional Arguments in Python With *args and **kwargs
Real Python
Python Context Managers and the "with" Statement (__enter__ & __exit__)
Real Python
Installing Python Packages with pip and virtualenv / venv
Real Python
"For Each" Loops in Python with enumerate() and range()
Real Python
Python Code Review: LibreOffice Automation and the Python Standard Library
Real Python
Managing Python Dependencies With Pip and Virtual Environments – Lesson #1
Real Python
Python Tutorial: List Comprehensions Step-By-Step
Real Python
Leveraging Python's Implicit "return None" Statements
Real Python
What's the meaning of underscores (_ & __) in Python variable names?
Real Python
Python Data Structures: Sets, Frozensets, and Multisets (Bags)
Real Python
Writing automated tests for Python command-line apps and scripts
Real Python
How to find great Python packages on PyPI, the Python Package Repository
Real Python
Immutable vs Mutable Objects in Python
Real Python
PyPI vs Warehouse, the Next-Generation Python Package Repository
Real Python
pep8.org — The Prettiest Way to View the PEP 8 Python Style Guide
Real Python
My Experience at PyCon 2017 in Portland
Real Python
Pylint Tutorial – How to Write Clean Python
Real Python
"Reverse a List in Python" Tutorial: Three Methods & How-to Demos
Real Python
Python Refactoring: "while True" Infinite Loops & The "input" Function
Real Python
More on: Tool Use & Function Calling
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
The AI Hype Cycle: Calm Before the Next Breakthrough?
Medium · Programming
AI won’t replace scientists. It will make the current model of science obsolete
Medium · Data Science
The End of Knowledge: Why Artificial Intelligence Is Changing Not Only What We Know, but What It…
Medium · AI
Japan Gave the World Robots, Bullet Trains, and PlayStation. So Why Is It Losing the AI Race?
Medium · AI
🎓
Tutor Explanation
DeepCamp AI